import api from './index'

// 获取商品列表
export const getProducts = (params = {}) => {
  return api.get('/products', { params })
}

// 获取商品详情
export const getProductDetail = (id) => {
  return api.get(`/products/${id}`)
}

// 搜索商品
export const searchProducts = (params = {}) => {
  return api.get('/search', { params })
}

// 获取热门搜索关键词
export const getSearchKeywords = () => {
  return api.get('/search/keywords')
}

// 获取轮播图
export const getBanners = () => {
  return api.get('/banners')
}

// 获取分类列表
export const getCategories = () => {
  return api.get('/categories')
}
